
export function isFiveSuccess(boardData,row,col){
    return axis (boardData,row,col)||verticalAxis(boardData,row,col)||Oblique(boardData,row,col)||ObliqueAxis (boardData,row,col)
}
// 横轴连成线
function axis (boardData,row,col){
    let count = 1
    for(let i = 1;col-i>=0;i++){
        if(boardData[row][col]===boardData[row][col-i]){
            count++
        }else{
            break
        }
    }
    for(let i = 1;col+i<15;i++){
        if(boardData[row][col]===boardData[row][col+i]){
            count++
        }else{
            break
        }
    }
    return count>=5
}
// 纵轴五子连线
function verticalAxis(boardData,row,col){
    let count = 1
    for(let i = 1;row-i>=0;i++){
        if(boardData[row][col]===boardData[row-i][col]){
            count++
        }else{
            break
        }
    }
    for(let i = 1;row+i<15;i++){
        if(boardData[row][col]===boardData[row+i][col]){
            count++
        }else{
            break
        }
    }
    return count>=5
}
// 反斜轴
function Oblique(boardData,row,col){
    let count = 1
    for(let i = 1; row-i>=0&&col-i>=0;i++){
        if(boardData[row][col]===boardData[row-i][col-i]){
            count++
        }else{
            break
        }
    }
    for(let i = 1;row+i<15&&col+i<15;i++){
        if(boardData[row][col]===boardData[row+i][col+i]){
            count++
        }else{
            break
        }
    }
    return count>=5
}
// 正斜轴
function ObliqueAxis (boardData,row,col){
    let count = 1
    for(let i = 1;row-i>=0 && col+i<15;i++){
        if(boardData[row][col]===boardData[row-i][col+i]){
            count++
        }else{
            break
        }
    }
    for(let i = 1;row+i<15 && col-i>=0;i++){
        if(boardData[row][col]===boardData[row+i][col-i]){
            count++
        }else{
            break
        }
    }
    return count>=5
}
